<?php
	class CModule
	{
		var $name;
		var $file;
		var $visible = true;

		function CModule($name, $url, $paramsArray=null)
		{
			$this->name = $name;
			$this->file = $url;
			if($paramsArray!=null) $this->paramize($paramsArray);
		}

		function paramize($ar)
		{
			foreach($ar as $k => $o)
				$this->$k = $o;
		}
	}

	$modules = array(
		'home'	=> new CModule('home', "home.php"),
		'test'	=> new CModule('home', "test.php"),
		'view'	=> new CModule('home', "table_view.php"),
		'msb'	=> new CModule('home', "mnu_sidebar.php", array('visible'=>false))
	);

	function display_module($module_name)
	{
		global $modules;
		if(isset($modules[$module_name]))
		{
			$g_module = $modules[$module_name]->name;
			include $modules[$module_name]->file;
		}
		else
		{
			echo "<strong>Modulo non trovato</strong>";
		}
	}
?>